home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / !Interfaces / Universal Interfaces 2.0a1 / PInterfaces / AppleTalk.p < prev    next >
Encoding:
Text File  |  1994-07-21  |  26.2 KB  |  774 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        AppleTalk.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a1.1  ETO #15, MPW prerelease.  Sunday, July 17, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT AppleTalk;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __APPLETALK__}
  27. {$SETC __APPLETALK__ := 1}
  28.  
  29. {$I+}
  30. {$SETC AppleTalkIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {    ConditionalMacros.p                                            }
  38.  
  39. {$IFC UNDEFINED __OSUTILS__}
  40. {$I OSUtils.p}
  41. {$ENDC}
  42. {    MixedMode.p                                                    }
  43.  
  44. {$PUSH}
  45. {$ALIGN MAC68K}
  46. {$LibExport+}
  47.  
  48. CONST
  49. { Driver unit and reference numbers (ADSP is dynamic) }
  50.     mppUnitNum                    = 9;                            { MPP unit number }
  51.     atpUnitNum                    = 10;                            { ATP unit number }
  52.     xppUnitNum                    = 40;                            { XPP unit number }
  53.     mppRefNum                    = -10;                            { MPP reference number }
  54.     atpRefNum                    = -11;                            { ATP reference number }
  55.     xppRefNum                    = -41;                            { XPP reference number }
  56. { .MPP csCodes }
  57.     lookupReply                    = 242;                            { This command queued to ourself }
  58.     writeLAP                    = 243;                            { Write out LAP packet }
  59.     detachPH                    = 244;                            { Detach LAP protocol handler }
  60.     attachPH                    = 245;                            { Attach LAP protocol handler }
  61.     writeDDP                    = 246;                            { Write out DDP packet }
  62.     closeSkt                    = 247;                            { Close DDP socket }
  63.     openSkt                        = 248;                            { Open DDP socket }
  64.     loadNBP                        = 249;                            { Load NBP command-executing code }
  65.     lastResident                = 249;                            { Last resident command }
  66.     confirmName                    = 250;                            { Confirm name }
  67.     lookupName                    = 251;                            { Look up name on internet }
  68.     removeName                    = 252;                            { Remove name from Names Table }
  69.     registerName                = 253;                            { Register name in Names Table }
  70.     killNBP                        = 254;                            { Kill outstanding NBP request }
  71.  
  72.     unloadNBP                    = 255;                            { Unload NBP command code }
  73.     setSelfSend                    = 256;                            { MPP: Set to allow writes to self }
  74.     SetMyZone                    = 257;                            { Set my zone name }
  75.     GetATalkInfo                = 258;                            { get AppleTalk information }
  76.     ATalkClosePrep                = 259;                            { AppleTalk close query }
  77. { .ATP csCodes }
  78.     nSendRequest                = 248;                            { NSendRequest code }
  79.     relRspCB                    = 249;                            { Release RspCB }
  80.     closeATPSkt                    = 250;                            { Close ATP socket }
  81.     addResponse                    = 251;                            { Add response code | Require open skt }
  82.     sendResponse                = 252;                            { Send response code }
  83.     getRequest                    = 253;                            { Get request code }
  84.     openATPSkt                    = 254;                            { Open ATP socket }
  85.     sendRequest                    = 255;                            { Send request code }
  86.     relTCB                        = 256;                            { Release TCB }
  87.     killGetReq                    = 257;                            { Kill GetRequest }
  88.     killSendReq                    = 258;                            { Kill SendRequest }
  89.     killAllGetReq                = 259;                            { Kill all getRequests for a skt }
  90. { .XPP csCodes }
  91.     openSess                    = 255;                            { Open session }
  92.     closeSess                    = 254;                            { Close session }
  93.     userCommand                    = 253;                            { User command }
  94.  
  95.     userWrite                    = 252;                            { User write }
  96.     getStatus                    = 251;                            { Get status }
  97.     afpCall                        = 250;                            { AFP command (buffer has command code) }
  98.     getParms                    = 249;                            { Get parameters }
  99.     abortOS                        = 248;                            { Abort open session request }
  100.     closeAll                    = 247;                            { Close all open sessions }
  101.     xCall                        = 246;                            { .XPP extended calls }
  102. { Transition Queue transition types }
  103.     ATTransOpen                    = 0;                            {AppleTalk has opened}
  104.     ATTransClose                = 2;                            {AppleTalk is about to close}
  105.     ATTransClosePrep            = 3;                            {Is it OK to close AppleTalk ?}
  106.     ATTransCancelClose            = 4;                            {Cancel the ClosePrep transition}
  107.     afpByteRangeLock            = 1;                            {AFPCall command codes}
  108.     afpVolClose                    = 2;                            {AFPCall command codes}
  109.     afpDirClose                    = 3;                            {AFPCall command codes}
  110.     afpForkClose                = 4;                            {AFPCall command codes}
  111.     afpCopyFile                    = 5;                            {AFPCall command codes}
  112.     afpDirCreate                = 6;                            {AFPCall command codes}
  113.     afpFileCreate                = 7;                            {AFPCall command codes}
  114.     afpDelete                    = 8;                            {AFPCall command codes}
  115.     afpEnumerate                = 9;                            {AFPCall command codes}
  116.  
  117.     afpFlush                    = 10;                            {AFPCall command codes}
  118.     afpForkFlush                = 11;                            {AFPCall command codes}
  119.     afpGetDirParms                = 12;                            {AFPCall command codes}
  120.     afpGetFileParms                = 13;                            {AFPCall command codes}
  121.     afpGetForkParms                = 14;                            {AFPCall command codes}
  122.     afpGetSInfo                    = 15;                            {AFPCall command codes}
  123.     afpGetSParms                = 16;                            {AFPCall command codes}
  124.     afpGetVolParms                = 17;                            {AFPCall command codes}
  125.     afpLogin                    = 18;                            {AFPCall command codes}
  126.     afpContLogin                = 19;                            {AFPCall command codes}
  127.     afpLogout                    = 20;                            {AFPCall command codes}
  128.     afpMapID                    = 21;                            {AFPCall command codes}
  129.     afpMapName                    = 22;                            {AFPCall command codes}
  130.     afpMove                        = 23;                            {AFPCall command codes}
  131.     afpOpenVol                    = 24;                            {AFPCall command codes}
  132.     afpOpenDir                    = 25;                            {AFPCall command codes}
  133.     afpOpenFork                    = 26;                            {AFPCall command codes}
  134.     afpRead                        = 27;                            {AFPCall command codes}
  135.     afpRename                    = 28;                            {AFPCall command codes}
  136.     afpSetDirParms                = 29;                            {AFPCall command codes}
  137.  
  138.     afpSetFileParms                = 30;                            {AFPCall command codes}
  139.     afpSetForkParms                = 31;                            {AFPCall command codes}
  140.     afpSetVolParms                = 32;                            {AFPCall command codes}
  141.     afpWrite                    = 33;                            {AFPCall command codes}
  142.     afpGetFlDrParms                = 34;                            {AFPCall command codes}
  143.     afpSetFlDrParms                = 35;                            {AFPCall command codes}
  144.     afpDTOpen                    = 48;                            {AFPCall command codes}
  145.     afpDTClose                    = 49;                            {AFPCall command codes}
  146.     afpGetIcon                    = 51;                            {AFPCall command codes}
  147.     afpGtIcnInfo                = 52;                            {AFPCall command codes}
  148.     afpAddAPPL                    = 53;                            {AFPCall command codes}
  149.     afpRmvAPPL                    = 54;                            {AFPCall command codes}
  150.     afpGetAPPL                    = 55;                            {AFPCall command codes}
  151.     afpAddCmt                    = 56;                            {AFPCall command codes}
  152.     afpRmvCmt                    = 57;                            {AFPCall command codes}
  153.     afpGetCmt                    = 58;                            {AFPCall command codes}
  154.     afpAddIcon                    = 192;                            {Special code for ASP Write commands}
  155.     xppLoadedBit                = 5;                            { XPP bit in PortBUse }
  156.     scbMemSize                    = 192;                            { Size of memory for SCB }
  157.     xppFlagClr                    = 0;                            { Cs for AFPCommandBlock }
  158.  
  159.     xppFlagSet                    = 128;                            { StartEndFlag & NewLineFlag fields. }
  160.     lapSize                        = 20;
  161.     ddpSize                        = 26;
  162.     nbpSize                        = 26;
  163.     atpSize                        = 56;
  164.     atpXOvalue                    = 32;                            {ATP exactly-once bit }
  165.     atpEOMvalue                    = 16;                            {ATP End-Of-Message bit }
  166.     atpSTSvalue                    = 8;                            {ATP Send-Transmission-Status bit }
  167.     atpTIDValidvalue            = 2;                            {ATP trans. ID valid bit }
  168.     atpSendChkvalue                = 1;                            {ATP send checksum bit }
  169.     zipGetLocalZones            = 5;
  170.     zipGetZoneList                = 6;
  171.     zipGetMyZone                = 7;
  172.     LAPMgrPtr                    = $B18;                            {Entry point for LAP Manager}
  173.     LAPMgrCall                    = 2;                            {Offset to LAP routines}
  174.     LAddAEQ                        = 23;                            {LAPAddATQ routine selector}
  175.     LRmvAEQ                        = 24;                            {LAPRmvATQ routine selector}
  176.  
  177.     tLAPRead                    = 0;
  178.     tLAPWrite                    = 1;
  179.     tDDPRead                    = 2;
  180.     tDDPWrite                    = 3;
  181.     tNBPLookup                    = 4;
  182.     tNBPConfirm                    = 5;
  183.     tNBPRegister                = 6;
  184.     tATPSndRequest                = 7;
  185.     tATPGetRequest                = 8;
  186.     tATPSdRsp                    = 9;
  187.     tATPAddRsp                    = 10;
  188.     tATPRequest                    = 11;
  189.     tATPResponse                = 12;
  190.  
  191.     
  192. TYPE
  193. ABCallType = SInt8;
  194.  
  195.  
  196. CONST
  197.     lapProto                    = 0;
  198.     ddpProto                    = 1;
  199.     nbpProto                    = 2;
  200.     atpProto                    = 3;
  201.  
  202.     
  203. TYPE
  204. ABProtoType = UInt8;
  205.  
  206.     ABByte = Byte;
  207.  
  208.     LAPAdrBlock = PACKED RECORD
  209.         dstNodeID:                UInt8;
  210.         srcNodeID:                UInt8;
  211.         lapProtType:            ABByte;
  212.         filler:                    UInt8;                                    {    Filler for proper byte alignment}
  213.     END;
  214.     ATQEntryPtr = ^ATQEntry;
  215.  
  216.     ATalkTransitionEventProcPtr = ProcPtr;  { FUNCTION ATalkTransitionEvent(eventCode: LONGINT; qElem: ATQEntryPtr; eventParameter: UNIV Ptr): LONGINT; }
  217.     ATalkTransitionEventUPP = UniversalProcPtr;
  218.  
  219.     ATalkTransitionEvent = ATalkTransitionEventUPP;
  220.  
  221.     ATQEntry = RECORD
  222.         qLink:                    ^ATQEntry;                                {next queue entry}
  223.         qType:                    INTEGER;                                {queue type}
  224.         CallAddr:                ATalkTransitionEventUPP;                {your routine descriptor}
  225.     END;
  226.     AddrBlock = RECORD
  227.         aNet:                    UInt16;
  228.         aNode:                    SInt8;
  229.         aSocket:                SInt8;
  230.     END;
  231. { Real definition of EntityName is 3 PACKED strings of any length (32 is just an example). No
  232. offests for Asm since each String address must be calculated by adding length byte to last string ptr.
  233. In Pascal, String(32) will be 34 bytes long since fields never start on an odd byte unless they are 
  234. only a byte long. So this will generate correct looking interfaces for Pascal and C, but they will not
  235. be the same, which is OK since they are not used. }
  236.     EntityName = RECORD
  237.         objStr:                    Str32;
  238.         pad1:                    SInt8;                                    {Str32's aligned on even word boundries.}
  239.         typeStr:                Str32;
  240.         pad2:                    SInt8;
  241.         zoneStr:                Str32;
  242.         pad3:                    SInt8;
  243.     END;
  244.     EntityPtr = ^EntityName;
  245.  
  246.     RetransType = PACKED RECORD
  247.         retransInterval:        UInt8;
  248.         retransCount:            UInt8;
  249.     END;
  250.     BDSElement = RECORD
  251.         buffSize:                INTEGER;
  252.         buffPtr:                Ptr;
  253.         dataSize:                INTEGER;
  254.         userBytes:                LONGINT;
  255.     END;
  256.     BDSType = ARRAY [0..7] OF BDSElement;
  257.  
  258.     BDSPtr = ^BDSElement;
  259.  
  260.     BitMapType = PACKED ARRAY [0..7] OF BOOLEAN;
  261.  
  262.     ATLAPRec = RECORD
  263.         abOpcode:                ABCallType;
  264.         filler:                    SInt8;                                    {    Filler for proper byte alignment}
  265.         abResult:                INTEGER;
  266.         abUserReference:        LONGINT;
  267.         lapAddress:                LAPAdrBlock;
  268.         lapReqCount:            INTEGER;
  269.         lapActCount:            INTEGER;
  270.         lapDataPtr:                Ptr;
  271.     END;
  272.     ATLAPRecPtr = ^ATLAPRec;
  273.     ATLAPRecHandle = ^ATLAPRecPtr;
  274.  
  275.     ATDDPRec = RECORD
  276.         abOpcode:                ABCallType;
  277.         filler:                    SInt8;                                    {    Filler for proper byte alignment}
  278.         abResult:                INTEGER;
  279.         abUserReference:        LONGINT;
  280.         ddpType:                INTEGER;
  281.         ddpSocket:                INTEGER;
  282.         ddpAddress:                AddrBlock;
  283.         ddpReqCount:            INTEGER;
  284.         ddpActCount:            INTEGER;
  285.         ddpDataPtr:                Ptr;
  286.         ddpNodeID:                INTEGER;
  287.     END;
  288.     ATDDPRecPtr = ^ATDDPRec;
  289.     ATDDPRecHandle = ^ATDDPRecPtr;
  290.  
  291.     ATNBPRec = RECORD
  292.         abOpcode:                ABCallType;
  293.         filler:                    SInt8;                                    {    Filler for proper byte alignment}
  294.         abResult:                INTEGER;
  295.         abUserReference:        LONGINT;
  296.         nbpEntityPtr:            EntityPtr;
  297.         nbpBufPtr:                Ptr;
  298.         nbpBufSize:                INTEGER;
  299.         nbpDataField:            INTEGER;
  300.         nbpAddress:                AddrBlock;
  301.         nbpRetransmitInfo:        RetransType;
  302.     END;
  303.     ATNBPRecPtr = ^ATNBPRec;
  304.     ATNBPRecHandle = ^ATNBPRecPtr;
  305.  
  306.     ATATPRec = RECORD
  307.         abOpcode:                ABCallType;
  308.         filler1:                SInt8;                                    {    Filler for proper byte alignment}
  309.         abResult:                INTEGER;
  310.         abUserReference:        LONGINT;
  311.         atpSocket:                INTEGER;
  312.         atpAddress:                AddrBlock;
  313.         atpReqCount:            INTEGER;
  314.         atpDataPtr:                Ptr;
  315.         atpRspBDSPtr:            BDSPtr;
  316.         atpBitMap:                BitMapType;
  317.         filler2:                SInt8;                                    {    Filler for proper byte alignment}
  318.         atpTransID:                INTEGER;
  319.         atpActCount:            INTEGER;
  320.         atpUserData:            LONGINT;
  321.         atpXO:                    BOOLEAN;
  322.         atpEOM:                    BOOLEAN;
  323.         atpTimeOut:                INTEGER;
  324.         atpRetries:                INTEGER;
  325.         atpNumBufs:                INTEGER;
  326.         atpNumRsp:                INTEGER;
  327.         atpBDSSize:                INTEGER;
  328.         atpRspUData:            LONGINT;
  329.         atpRspBuf:                Ptr;
  330.         atpRspSize:                INTEGER;
  331.     END;
  332.     ATATPRecPtr = ^ATATPRec;
  333.     ATATPRecHandle = ^ATATPRecPtr;
  334.  
  335.     AFPCommandBlock = PACKED RECORD
  336.         cmdByte:                UInt8;
  337.         startEndFlag:            UInt8;
  338.         forkRefNum:                INTEGER;
  339.         rwOffset:                LONGINT;
  340.         reqCount:                LONGINT;
  341.         newLineFlag:            UInt8;
  342.         newLineChar:            CHAR;
  343.     END;
  344.     MPPPBPtr = ^MPPParamBlock;
  345.  
  346.     ATPPBPtr = ^ATPParamBlock;
  347.  
  348.     XPPParmBlkPtr = ^XPPParamBlock;
  349.  
  350.     {
  351.         MPPCompletionProcPtr uses register based parameters on the 68k and cannot
  352.         be written in or called from a high-level language without the help of
  353.         mixed mode or assembly glue.
  354.  
  355.         In:
  356.          => thePBptr        A0.L
  357.     }
  358.     MPPCompletionProcPtr = ProcPtr;  { PROCEDURE MPPCompletion(thePBptr: MPPPBPtr); }
  359.     {
  360.         ATPCompletionProcPtr uses register based parameters on the 68k and cannot
  361.         be written in or called from a high-level language without the help of
  362.         mixed mode or assembly glue.
  363.  
  364.         In:
  365.          => thePBptr        A0.L
  366.     }
  367.     ATPCompletionProcPtr = ProcPtr;  { PROCEDURE ATPCompletion(thePBptr: ATPPBPtr); }
  368.     {
  369.         XPPCompletionProcPtr uses register based parameters on the 68k and cannot
  370.         be written in or called from a high-level language without the help of
  371.         mixed mode or assembly glue.
  372.  
  373.         In:
  374.          => thePBptr        A0.L
  375.     }
  376.     XPPCompletionProcPtr = ProcPtr;  { PROCEDURE XPPCompletion(thePBptr: XPPParmBlkPtr); }
  377.     {
  378.         AttnRoutineProcPtr uses register based parameters on the 68k and cannot
  379.         be written in or called from a high-level language without the help of
  380.         mixed mode or assembly glue.
  381.  
  382.         In:
  383.          => sessRefnum      D0.W
  384.          => attnBytes       D1.W
  385.     }
  386.     AttnRoutineProcPtr = ProcPtr;  { PROCEDURE AttnRoutine(sessRefnum: INTEGER; attnBytes: INTEGER); }
  387.     MPPCompletionUPP = UniversalProcPtr;
  388.     ATPCompletionUPP = UniversalProcPtr;
  389.     XPPCompletionUPP = UniversalProcPtr;
  390.     AttnRoutineUPP = UniversalProcPtr;
  391.  
  392.     WDSElement = RECORD
  393.         entryLength:            INTEGER;
  394.         entryPtr:                Ptr;
  395.     END;
  396.     NTElement = RECORD
  397.         nteAddress:                AddrBlock;                                {network address of entity}
  398.         filler:                    SInt8;
  399.         entityData:                PACKED ARRAY [0..98] OF SInt8;            {Object, Type & Zone}
  400.     END;
  401.     NamesTableEntry = RECORD
  402.         qNext:                    Ptr;                                    {ptr to next NTE}
  403.         nt:                        NTElement;
  404.     END;
  405.     MPPProtocolHandlerProcPtr = ProcPtr;  { FUNCTION MPPProtocolHandler(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; numBytesLeftToReadInPacket: INTEGER): BOOLEAN; }
  406.     DDPSocketListenerProcPtr = ProcPtr;  { FUNCTION DDPSocketListener(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; packetDestinationNumber: ByteParameter; numBytesLeftToReadInPacket: INTEGER): BOOLEAN; }
  407.     MPPProtocolHandlerUPP = UniversalProcPtr;
  408.     DDPSocketListenerUPP = UniversalProcPtr;
  409.  
  410.     MPPParamBlock = RECORD
  411.         qLink:                    ^QElem;
  412.         qType:                    INTEGER;
  413.         ioTrap:                    INTEGER;
  414.         ioCmdAddr:                Ptr;
  415.         ioCompletion:            ATPCompletionUPP;
  416.         ioResult:                OSErr;
  417.         userData:                LONGINT;
  418.         reqTID:                    INTEGER;
  419.         ioRefNum:                INTEGER;
  420.         csCode:                    INTEGER;
  421.         CASE INTEGER OF
  422.         0: (
  423.             filler0:                    INTEGER;
  424.             wdsPointer:                    Ptr;
  425.            );
  426.         1: (
  427.             protType:                    SInt8;
  428.             filler:                        SInt8;
  429.             handler:                    MPPProtocolHandlerUPP;
  430.            );
  431.         2: (
  432.             socket:                        SInt8;
  433.             checksumFlag:                SInt8;
  434.             listener:                    DDPSocketListenerUPP;
  435.            );
  436.         3: (
  437.             interval:                    SInt8;                                {retry interval }
  438.             count:                        SInt8;                                {retry count }
  439.             nbpPtrs:                    Ptr;
  440.             CASE INTEGER OF
  441.             0: (
  442.                 verifyFlag:                        SInt8;
  443.                 filler3:                        SInt8;
  444.                );
  445.             1: (
  446.                 retBuffPtr:                        Ptr;
  447.                 retBuffSize:                    INTEGER;
  448.                 maxToGet:                        INTEGER;
  449.                 numGotten:                        INTEGER;
  450.                );
  451.             2: (
  452.                 confirmAddr:                    AddrBlock;
  453.                 newSocket:                        SInt8;
  454.                 filler4:                        SInt8;
  455.                );
  456.            );
  457.         4: (
  458.             newSelfFlag:                SInt8;                                {self-send toggle flag }
  459.             oldSelfFlag:                SInt8;                                {previous self-send state }
  460.            );
  461.         5: (
  462.             nKillQEl:                    Ptr;                                {ptr to i/o queue element to cancel }
  463.            );
  464.         6: (
  465.             version:                    INTEGER;
  466.             varsPtr:                    Ptr;
  467.             DCEPtr:                        Ptr;
  468.             portID:                        INTEGER;
  469.             configuration:                LONGINT;
  470.             selfSend:                    INTEGER;
  471.             netLo:                        INTEGER;
  472.             netHi:                        INTEGER;
  473.             ourAdd:                        LONGINT;
  474.             routerAddr:                    LONGINT;
  475.             numOfPHs:                    INTEGER;
  476.             numOfSkts:                    INTEGER;
  477.             numNBPEs:                    INTEGER;
  478.             nTQueue:                    Ptr;
  479.             LAlength:                    INTEGER;
  480.             linkAddr:                    Ptr;
  481.             zoneName:                    Ptr;
  482.            );
  483.         7: (
  484.             appName:                    Ptr;                                {pointer to application name in buffer}
  485.            );
  486.     END;
  487.  
  488.     XPPParamBlock = RECORD
  489.         qLink:                    ^QElem;
  490.         qType:                    INTEGER;
  491.         ioTrap:                    INTEGER;
  492.         ioCmdAddr:                Ptr;
  493.         ioCompletion:            XPPCompletionUPP;
  494.         ioResult:                OSErr;
  495.         cmdResult:                LONGINT;
  496.         ioVRefNum:                INTEGER;
  497.         ioRefNum:                INTEGER;
  498.         csCode:                    INTEGER;
  499.         CASE INTEGER OF
  500.         0: (
  501.             abortSCBPtr:                Ptr;                                { SCB pointer for AbortOS}
  502.            );
  503.         1: (
  504.             aspMaxCmdSize:                INTEGER;
  505.             aspQuantumSize:                INTEGER;
  506.             numSesss:                    INTEGER;
  507.            );
  508.         2: (
  509.             sessRefnum:                    INTEGER;
  510.             aspTimeout:                    SInt8;
  511.             aspRetry:                    SInt8;
  512.             CASE INTEGER OF
  513.             0: (
  514.                 serverAddr:                        AddrBlock;
  515.                 scbPointer:                        Ptr;
  516.                 attnRoutine:                    AttnRoutineUPP;
  517.                );
  518.             1: (
  519.                 cbSize:                            INTEGER;
  520.                 cbPtr:                            Ptr;
  521.                 rbSize:                            INTEGER;
  522.                 rbPtr:                            Ptr;
  523.                 CASE INTEGER OF
  524.                 0: (
  525.                     afpAddrBlock:                        AddrBlock;
  526.                     afpSCBPtr:                            Ptr;
  527.                     afpAttnRoutine:                        Ptr;
  528.                    );
  529.                 1: (
  530.                     wdSize:                                INTEGER;
  531.                     wdPtr:                                Ptr;
  532.                     ccbStart:                            ARRAY [0..295] OF SInt8;
  533.                    );
  534.                );
  535.            );
  536.         3: (
  537.             xppSubCode:                    INTEGER;
  538.             xppTimeout:                    SInt8;
  539.             xppRetry:                    SInt8;
  540.             filler1:                    INTEGER;
  541.             zipBuffPtr:                    Ptr;
  542.             zipNumZones:                INTEGER;
  543.             zipLastFlag:                SInt8;
  544.             filler2:                    SInt8;
  545.             zipInfoField:                PACKED ARRAY [0..69] OF SInt8;
  546.            );
  547.     END;
  548.  
  549.     ATPParamBlock = RECORD
  550.         qLink:                    ^QElem;
  551.         qType:                    INTEGER;
  552.         ioTrap:                    INTEGER;
  553.         ioCmdAddr:                Ptr;
  554.         ioCompletion:            ATPCompletionUPP;
  555.         ioResult:                OSErr;
  556.         userData:                LONGINT;
  557.         reqTID:                    INTEGER;
  558.         ioRefNum:                INTEGER;
  559.         csCode:                    INTEGER;
  560.         atpSocket:                SInt8;
  561.         atpFlags:                SInt8;
  562.         addrBlock:                AddrBlock;
  563.         reqLength:                INTEGER;
  564.         reqPointer:                Ptr;
  565.         bdsPointer:                Ptr;
  566.         CASE INTEGER OF
  567.         0: (
  568.             numOfBuffs:                    SInt8;
  569.             timeOutVal:                    SInt8;
  570.             numOfResps:                    SInt8;
  571.             retryCount:                    SInt8;
  572.             intBuff:                    INTEGER;
  573.             TRelTime:                    SInt8;
  574.            );
  575.         1: (
  576.             filler:                        SInt8;
  577.             bdsSize:                    SInt8;
  578.             transID:                    INTEGER;
  579.            );
  580.         2: (
  581.             bitMap:                        SInt8;
  582.             filler2:                    SInt8;
  583.            );
  584.         3: (
  585.             rspNum:                        SInt8;
  586.             filler3:                    SInt8;
  587.            );
  588.         4: (
  589.             aKillQEl:                    Ptr;
  590.            );
  591.     END;
  592.  
  593.  
  594. CONST
  595.     uppATalkTransitionEventProcInfo = $00000FF1; { FUNCTION (4 byte param, 4 byte param, 4 byte param): 4 byte result; }
  596.     uppMPPCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  597.     uppATPCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  598.     uppXPPCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  599.     uppAttnRoutineProcInfo = $00061002; { Register PROCEDURE (2 bytes in D0, 2 bytes in D1); }
  600.     uppMPPProtocolHandlerProcInfo = $0000007F; { SPECIAL_CASE_PROCINFO( kSpecialCaseProtocolHandler ) }
  601.     uppDDPSocketListenerProcInfo = $0000008F; { SPECIAL_CASE_PROCINFO( kSpecialCaseSocketListener ) }
  602.  
  603. FUNCTION NewATalkTransitionEventProc(userRoutine: ATalkTransitionEventProcPtr): ATalkTransitionEventUPP;
  604.     {$IFC NOT GENERATINGCFM }
  605.     INLINE $2E9F;
  606.     {$ENDC}
  607.  
  608. FUNCTION NewMPPCompletionProc(userRoutine: MPPCompletionProcPtr): MPPCompletionUPP;
  609.     {$IFC NOT GENERATINGCFM }
  610.     INLINE $2E9F;
  611.     {$ENDC}
  612.  
  613. FUNCTION NewATPCompletionProc(userRoutine: ATPCompletionProcPtr): ATPCompletionUPP;
  614.     {$IFC NOT GENERATINGCFM }
  615.     INLINE $2E9F;
  616.     {$ENDC}
  617.  
  618. FUNCTION NewXPPCompletionProc(userRoutine: XPPCompletionProcPtr): XPPCompletionUPP;
  619.     {$IFC NOT GENERATINGCFM }
  620.     INLINE $2E9F;
  621.     {$ENDC}
  622.  
  623. FUNCTION NewAttnRoutineProc(userRoutine: AttnRoutineProcPtr): AttnRoutineUPP;
  624.     {$IFC NOT GENERATINGCFM }
  625.     INLINE $2E9F;
  626.     {$ENDC}
  627.  
  628. FUNCTION NewMPPProtocolHandlerProc(userRoutine: MPPProtocolHandlerProcPtr): MPPProtocolHandlerUPP;
  629.     {$IFC NOT GENERATINGCFM }
  630.     INLINE $2E9F;
  631.     {$ENDC}
  632.  
  633. FUNCTION NewDDPSocketListenerProc(userRoutine: DDPSocketListenerProcPtr): DDPSocketListenerUPP;
  634.     {$IFC NOT GENERATINGCFM }
  635.     INLINE $2E9F;
  636.     {$ENDC}
  637.  
  638. FUNCTION CallATalkTransitionEventProc(eventCode: LONGINT; qElem: ATQEntryPtr; eventParameter: UNIV Ptr; userRoutine: ATalkTransitionEventUPP): LONGINT;
  639.     {$IFC NOT GENERATINGCFM}
  640.     INLINE $205F, $4E90;
  641.     {$ENDC}
  642.  
  643. PROCEDURE CallMPPCompletionProc(thePBptr: MPPPBPtr; userRoutine: MPPCompletionUPP);
  644.     {$IFC NOT GENERATINGCFM}
  645.     {To be implemented:  Glue to move parameters into registers.}
  646.     {$ENDC}
  647.  
  648. PROCEDURE CallATPCompletionProc(thePBptr: ATPPBPtr; userRoutine: ATPCompletionUPP);
  649.     {$IFC NOT GENERATINGCFM}
  650.     {To be implemented:  Glue to move parameters into registers.}
  651.     {$ENDC}
  652.  
  653. PROCEDURE CallXPPCompletionProc(thePBptr: XPPParmBlkPtr; userRoutine: XPPCompletionUPP);
  654.     {$IFC NOT GENERATINGCFM}
  655.     {To be implemented:  Glue to move parameters into registers.}
  656.     {$ENDC}
  657.  
  658. PROCEDURE CallAttnRoutineProc(sessRefnum: INTEGER; attnBytes: INTEGER; userRoutine: AttnRoutineUPP);
  659.     {$IFC NOT GENERATINGCFM}
  660.     {To be implemented:  Glue to move parameters into registers.}
  661.     {$ENDC}
  662.  
  663. FUNCTION CallMPPProtocolHandlerProc(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; numBytesLeftToReadInPacket: INTEGER; userRoutine: MPPProtocolHandlerUPP): BOOLEAN;
  664.     {$IFC NOT GENERATINGCFM}
  665.     {To be implemented:  Glue to move parameters according to special case conventions.}
  666.     {$ENDC}
  667.  
  668. FUNCTION CallDDPSocketListenerProc(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; packetDestinationNumber: ByteParameter; numBytesLeftToReadInPacket: INTEGER; userRoutine: DDPSocketListenerUPP): BOOLEAN;
  669.     {$IFC NOT GENERATINGCFM}
  670.     {To be implemented:  Glue to move parameters according to special case conventions.}
  671.     {$ENDC}
  672.  
  673. FUNCTION OpenXPP(VAR xppRefnum: INTEGER): OSErr;
  674. FUNCTION ASPOpenSession(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  675. FUNCTION ASPCloseSession(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  676. FUNCTION ASPAbortOS(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  677. FUNCTION ASPGetParms(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  678. FUNCTION ASPCloseAll(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  679. FUNCTION ASPUserWrite(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  680. FUNCTION ASPUserCommand(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  681. FUNCTION ASPGetStatus(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  682. FUNCTION AFPCommand(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  683. FUNCTION GetLocalZones(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  684. FUNCTION GetZoneList(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  685. FUNCTION GetMyZone(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  686. FUNCTION PAttachPH(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  687. FUNCTION PDetachPH(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  688. FUNCTION PWriteLAP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  689. FUNCTION POpenSkt(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  690. FUNCTION PCloseSkt(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  691. FUNCTION PWriteDDP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  692. FUNCTION PRegisterName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  693. FUNCTION PLookupName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  694. FUNCTION PConfirmName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  695. FUNCTION PRemoveName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  696. FUNCTION PSetSelfSend(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  697. FUNCTION PKillNBP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  698. FUNCTION PGetAppleTalkInfo(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  699. FUNCTION PATalkClosePrep(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  700. FUNCTION POpenATPSkt(thePBptr: ATPPBPtr; async: BOOLEAN): OSErr;
  701. FUNCTION PCloseATPSkt(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  702. FUNCTION PSendRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  703. FUNCTION PGetRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  704. FUNCTION PSendResponse(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  705. FUNCTION PAddResponse(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  706. FUNCTION PRelTCB(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  707. FUNCTION PRelRspCB(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  708. FUNCTION PNSendRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  709. FUNCTION PKillSendReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  710. FUNCTION PKillGetReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  711. FUNCTION ATPKillAllGetReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  712. PROCEDURE BuildLAPwds(wdsPtr: Ptr; dataPtr: Ptr; destHost: INTEGER; prototype: INTEGER; frameLen: INTEGER);
  713. PROCEDURE BuildDDPwds(wdsPtr: Ptr; headerPtr: Ptr; dataPtr: Ptr; netAddr: AddrBlock; ddpType: INTEGER; dataLen: INTEGER);
  714. PROCEDURE NBPSetEntity(buffer: Ptr; nbpObject: ConstStr32Param; nbpType: ConstStr32Param; nbpZone: ConstStr32Param);
  715. PROCEDURE NBPSetNTE(ntePtr: Ptr; nbpObject: ConstStr32Param; nbpType: ConstStr32Param; nbpZone: ConstStr32Param; socket: INTEGER);
  716. FUNCTION GetBridgeAddress: INTEGER;
  717. FUNCTION BuildBDS(buffPtr: Ptr; bdsPtr: Ptr; buffSize: INTEGER): INTEGER;
  718. FUNCTION MPPOpen: OSErr;
  719. FUNCTION LAPAddATQ(theATQEntry: ATQEntryPtr): OSErr;
  720. FUNCTION LAPRmvATQ(theATQEntry: ATQEntryPtr): OSErr;
  721. FUNCTION ATPLoad: OSErr;
  722. FUNCTION ATPUnload: OSErr;
  723. FUNCTION NBPExtract(theBuffer: Ptr; numInBuf: INTEGER; whichOne: INTEGER; VAR abEntity: EntityName; VAR address: AddrBlock): OSErr;
  724. FUNCTION GetNodeAddress(VAR myNode: INTEGER; VAR myNet: INTEGER): OSErr;
  725. FUNCTION IsMPPOpen: BOOLEAN;
  726. FUNCTION IsATPOpen: BOOLEAN;
  727. PROCEDURE ATEvent(event: LONGINT; infoPtr: Ptr);
  728. FUNCTION ATPreFlightEvent(event: LONGINT; cancel: LONGINT; infoPtr: Ptr): OSErr;
  729. {
  730.     The following routines are obsolete and will not be supported on
  731.     PowerPC. Equivalent functionality is provided by the routines
  732.     above.
  733. }
  734. {$IFC OLDROUTINENAMES  & NOT GENERATINGCFM }
  735. FUNCTION MPPClose: OSErr;
  736. FUNCTION LAPOpenProtocol(theLAPType: ByteParameter; protoPtr: Ptr): OSErr;
  737. FUNCTION LAPCloseProtocol(theLAPType: ByteParameter): OSErr;
  738. FUNCTION LAPWrite(abRecord: ATLAPRecHandle; async: BOOLEAN): OSErr;
  739. FUNCTION LAPRead(abRecord: ATLAPRecHandle; async: BOOLEAN): OSErr;
  740. FUNCTION LAPRdCancel(abRecord: ATLAPRecHandle): OSErr;
  741. FUNCTION DDPOpenSocket(VAR theSocket: INTEGER; sktListener: Ptr): OSErr;
  742. FUNCTION DDPCloseSocket(theSocket: INTEGER): OSErr;
  743. FUNCTION DDPRead(abRecord: ATDDPRecHandle; retCksumErrs: BOOLEAN; async: BOOLEAN): OSErr;
  744. FUNCTION DDPWrite(abRecord: ATDDPRecHandle; doChecksum: BOOLEAN; async: BOOLEAN): OSErr;
  745. FUNCTION DDPRdCancel(abRecord: ATDDPRecHandle): OSErr;
  746. FUNCTION ATPOpenSocket(addrRcvd: AddrBlock; VAR atpSocket: INTEGER): OSErr;
  747. FUNCTION ATPCloseSocket(atpSocket: INTEGER): OSErr;
  748. FUNCTION ATPSndRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  749. FUNCTION ATPRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  750. FUNCTION ATPReqCancel(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  751. FUNCTION ATPGetRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  752. FUNCTION ATPSndRsp(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  753. FUNCTION ATPAddRsp(abRecord: ATATPRecHandle): OSErr;
  754. FUNCTION ATPResponse(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  755. FUNCTION ATPRspCancel(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  756. FUNCTION NBPRegister(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  757. FUNCTION NBPLookup(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  758. FUNCTION NBPConfirm(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  759. FUNCTION NBPRemove(abEntity: EntityPtr): OSErr;
  760. FUNCTION NBPLoad: OSErr;
  761. FUNCTION NBPUnload: OSErr;
  762. {$ENDC}
  763.  
  764. {$ALIGN RESET}
  765. {$POP}
  766.  
  767. {$SETC UsingIncludes := AppleTalkIncludes}
  768.  
  769. {$ENDC} {__APPLETALK__}
  770.  
  771. {$IFC NOT UsingIncludes}
  772.  END.
  773. {$ENDC}
  774.